import sys
from PyQt6.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QPushButton, QVBoxLayout, QWidget

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("My App")
        layout = QVBoxLayout()
        self.label = QLabel("Enter your name:")
        layout.addWidget(self.label)
        self.input = QLineEdit()
        layout.addWidget(self.input)
        self.button = QPushButton("Click Me")
        layout.addWidget(self.button)
        widget = QWidget()
        widget.setLayout(layout)
        self.setCentralWidget(widget)
        self.button.clicked.connect(self.handle_click)

    def handle_click(self):
        name = self.input.text()
        self.label.setText(f"Hello {name}!")

app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()
